home *** CD-ROM | disk | FTP | other *** search
/ Aminet 24 / Aminet 24 (1998)(GTI - Schatztruhe)[!][Apr 1998].iso / Aminet / dev / misc / Hunk.lha / Hunk / Hoppers / Dice_206.hop < prev    next >
Text File  |  1998-02-14  |  8KB  |  184 lines

  1. ;*************************************************************************
  2. ;** Dice v2.06 (Freeware)                                               **
  3. ;** Contributor: L.Lucius                               Sept 11th 1995  **
  4. ;** Modified for HOp:   Thomas Richter  (thor)          Nov  1st  1997  **
  5. ;** Function:    Modify 68000 math routines to use 68020+ instructions. **
  6. ;*************************************************************************
  7.  
  8.  
  9. ;*************************************************************************
  10. ;
  11. ; Divs
  12. ;
  13. #match
  14. #code
  15. 4A81                            ;   TST.L       D1
  16. 6B08                            ;   BMI.B       000C
  17. 4A80                            ;   TST.L       D0
  18. 6B12                            ;   BMI.B       001A
  19. 6000 YYYY                       ;   BRA.W       0009
  20. 4481                            ;   NEG.L       D1
  21. 4A80                            ;   TST.L       D0
  22. 6B12                            ;   BMI.B       0024
  23. 6100 YYYY                       ;   BSR.W       0013
  24. 4480                            ;   NEG.L       D0
  25. 4E75                            ;   RTS
  26. 4480                            ;   NEG.L       D0
  27. 6100 YYYY                       ;   BSR.W       001D
  28. 4480                            ;   NEG.L       D0
  29. 4E75                            ;   RTS
  30. 4480                            ;   NEG.L       D0
  31. 6000 YYYY                       ;   BRA.W       0027
  32. ;
  33. ;
  34. #replace
  35. 4C41 0801                       ;   DIVSL.L     D1,D1:D0
  36. 4E75                            ;   RTS
  37. #end
  38.  
  39.  
  40.  
  41. ;*************************************************************************
  42. ;
  43. ; Divu
  44. ;
  45. #match
  46. #code
  47. 4A81                            ;   TST.L       D1
  48. 671E                            ;   BEQ.B       0022
  49. 4841                            ;   SWAP        D1
  50. 4A41                            ;   TST.W       D1
  51. 6642                            ;   BNE.B       004C
  52. 2F02                            ;   MOVE.L      D2,-(A7)
  53. 4841                            ;   SWAP        D1
  54. 2400                            ;   MOVE.L      D0,D2
  55. 84C1                            ;   DIVU.W      D1,D2
  56. 6914                            ;   BVS.B       0028
  57. 2202                            ;   MOVE.L      D2,D1
  58. 4241                            ;   CLR.W       D1
  59. 4841                            ;   SWAP        D1
  60. 7000                            ;   MOVEQ       #00,D0
  61. 3002                            ;   MOVE.W      D2,D0
  62. 241F                            ;   MOVE.L      (A7)+,D2
  63. 4E75                            ;   RTS
  64. 2200                            ;   MOVE.L      D0,D1
  65. 70FF                            ;   MOVEQ       #FF,D0
  66. 4E75                            ;   RTS
  67. 2F03                            ;   MOVE.L      D3,-(A7)
  68. 2400                            ;   MOVE.L      D0,D2
  69. 4242                            ;   CLR.W       D2
  70. 4842                            ;   SWAP        D2
  71. 84C1                            ;   DIVU.W      D1,D2
  72. 3602                            ;   MOVE.W      D2,D3
  73. 4843                            ;   SWAP        D3
  74. 4243                            ;   CLR.W       D3
  75. 3400                            ;   MOVE.W      D0,D2
  76. 84C1                            ;   DIVU.W      D1,D2
  77. 3602                            ;   MOVE.W      D2,D3
  78. 2003                            ;   MOVE.L      D3,D0
  79. 4242                            ;   CLR.W       D2
  80. 4842                            ;   SWAP        D2
  81. 2202                            ;   MOVE.L      D2,D1
  82. 261F                            ;   MOVE.L      (A7)+,D3
  83. 241F                            ;   MOVE.L      (A7)+,D2
  84. 4E75                            ;   RTS
  85. 48E7 3800                       ;   MOVEM.L     D2-D4,-(A7)
  86. 2400                            ;   MOVE.L      D0,D2
  87. 4242                            ;   CLR.W       D2
  88. 4842                            ;   SWAP        D2
  89. 84C1                            ;   DIVU.W      D1,D2
  90. 3602                            ;   MOVE.W      D2,D3
  91. 7400                            ;   MOVEQ       #00,D2
  92. 3403                            ;   MOVE.W      D3,D2
  93. C6C1                            ;   MULU.W      D1,D3
  94. 4841                            ;   SWAP        D1
  95. 3802                            ;   MOVE.W      D2,D4
  96. C8C1                            ;   MULU.W      D1,D4
  97. 4843                            ;   SWAP        D3
  98. D684                            ;   ADD.L       D4,D3
  99. 9083                            ;   SUB.L       D3,D0
  100. 6B0A                            ;   BMI.B       0078
  101. 2200                            ;   MOVE.L      D0,D1
  102. 2002                            ;   MOVE.L      D2,D0
  103. 4CDF 001C                       ;   MOVEM.L     (A7)+,D2-D4
  104. 4E75                            ;   RTS
  105. 5382                            ;   SUBQ.L      #1,D2
  106. D081                            ;   ADD.L       D1,D0
  107. 6BFA                            ;   BMI.B       0078
  108. 2200                            ;   MOVE.L      D0,D1
  109. 2002                            ;   MOVE.L      D2,D0
  110. 4CDF 001C                       ;   MOVEM.L     (A7)+,D2-D4
  111. 4E75                            ;   RTS
  112. ;
  113. ;
  114. #replace
  115. 4C41 0001                       ;   DIVUL.L     D1,D1:D0
  116. 4E75                            ;   RTS
  117. #end
  118.  
  119.  
  120. ;*************************************************************************
  121. ;
  122. ; Mods
  123. ;
  124. #match
  125. #code
  126. 4A81                            ;   TST.L       D1
  127. 6B0C                            ;   BMI.B       0010
  128. 4A80                            ;   TST.L       D0
  129. 6B18                            ;   BMI.B       0020
  130. 6100 YYYY                       ;   BSR.W       0009
  131. 2001                            ;   MOVE.L      D1,D0
  132. 4E75                            ;   RTS
  133. 4481                            ;   NEG.L       D1
  134. 4A80                            ;   TST.L       D0
  135. 6B16                            ;   BMI.B       002C
  136. 6100 YYYY                       ;   BSR.W       0017
  137. 4481                            ;   NEG.L       D1
  138. 2001                            ;   MOVE.L      D1,D0
  139. 4E75                            ;   RTS
  140. 4480                            ;   NEG.L       D0
  141. 6100 YYYY                       ;   BSR.W       0023
  142. 4481                            ;   NEG.L       D1
  143. 2001                            ;   MOVE.L      D1,D0
  144. 4E75                            ;   RTS
  145. 4480                            ;   NEG.L       D0
  146. 6100 FFFF                       ;   BSR.W       002F
  147. 2001                            ;   MOVE.L      D1,D0
  148. 4E75                            ;   RTS
  149. ;
  150. ;
  151. #replace
  152. 4C41 0801                       ;   DIVSL.L     D1,D1:D0
  153. C141                            ;   EXG         D0,D1
  154. 4E75                            ;   RTS
  155. #end
  156.  
  157.  
  158. ;*************************************************************************
  159. ;
  160. ; Mulu/Muls
  161. ;
  162. #match
  163. #code
  164. 48E7 C000                       ;   MOVEM.L     D0-D1,-(A7)
  165. 4840                            ;   SWAP        D0
  166. C0C1                            ;   MULU.W      D1,D0
  167. 4841                            ;   SWAP        D1
  168. C2EF 0002                       ;   MULU.W      0002(A7),D1
  169. D081                            ;   ADD.L       D1,D0
  170. 4840                            ;   SWAP        D0
  171. 4240                            ;   CLR.W       D0
  172. 322F 0002                       ;   MOVE.W      0002(A7),D1
  173. C2EF 0006                       ;   MULU.W      0006(A7),D1
  174. D081                            ;   ADD.L       D1,D0
  175. 508F                            ;   ADDQ.L      #8,A7
  176. 4E75                            ;   RTS
  177. ;
  178. ;
  179. #replace
  180. 4C01 0000                       ;   MULU.L      D1,D0
  181. 4E75                            ;   RTS
  182. #end
  183.  
  184.